package work20241126_27;

/**
 * @author zdl
 * @date 2024/11/26
 */
public class Demo4 {
    public static void main(String[] args) {
        //3.设计整型数组,输出数组中的最大值的下标
        int[] arr = {2,9,1};
        int maxIndex = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[maxIndex] < arr[i]){
                maxIndex = i;
            }
        }
        System.out.println(maxIndex);
    }
}
